package com.tracker.impl;

import java.util.HashSet;
import java.util.Set;

import com.tracker.bean.Device;
import com.tracker.session.DeviceSession;


public class DeviceImpl {
	
	private HashSet device = new HashSet();

	public void save(Device device) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->SAVE  ########################");
			(new DeviceSession()).add(device);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Device get(Device device) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->GET  ########################");
			return (new DeviceSession()).get(device);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Set list(Device device) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->LIST  ########################");
			return (new DeviceSession()).list(device);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public void remove(Device device) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->LIST  ########################");
			(new DeviceSession()).delete(device);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	

}
